App({
  globalData: {
    userInfo: null
  },
  onLaunch: function () {
    wx.cloud.init({
      env: 'cdjclzh-0gvvn8usdb606483',
      traceUser: true
    })
    wx.cloud.callFunction({
      name: 'getOpenId'
    }).then(res=>{
      wx.cloud.database().collection('book-user').where({
        _openid: res.result.openid
      }).get({
        success:(result)=>{
          this.globalData.userInfo = result.data[0]
        }
      })
    })
  }
});
